An Open-Source Modelica Library of Fluid Power Models
نویسنده
چکیده
In this paper, a new open-source library of fluid power models is introduced. The intent of the library is to formally collect knowledge about fluid power components and systems, and to share and communicate this knowledge openly among the members of the fluid power community. The library takes advantage of the object-oriented features of the Modelica language to formulate the models in a formal, modular and reusable fashion. The models range from low-level fluid models and models for physical flow phenomena to models for specific fluid power components and systems. In this paper, the key features of the library are highlighted and illustrated with examples. 1. WHY ANOTHER FLUID POWER MODELING TOOL? Over the last several decades, system designers have recognized that the use of modeling and simulation can significantly reduce the resources necessary for exploring and analyzing the space of system alternatives. As a result, modeling and simulation of fluid power systems also has grown significantly in popularity and capability. Several dynamic simulation tools for fluid power systems have been developed both in academia (10, 17) and commercially (4, 9, 11, 13) (see http://fluid.power.net/fpn/docs/software.php3 for a comprehensive list of fluid power simulation tools). Although these tools provide more than adequate support for the analysis of simple hydraulic circuits, they often come up short when a higher level of accuracy is required or when applications outside the traditional scope of fluid power systems are explored. For instance, in very high pressure applications, the fluid viscosity depends strongly on the pressure, requiring the use of more detailed fluid models; or in electro-hydraulics, the bandwidth of the dynamic response of components often needs to be considered. Rather than developing a completely new set of models and a corresponding simulation tool for each of these application domains, it is desirable to have a library of simulation models that is modular and extensible so that it can be easily adapted to new needs. In this paper, such a library of fluid power models is introduced. The library has been designed with the following five primary goals in mind: 1. Integration with other disciplinary domains. The main purpose of fluid power systems is to transfer energy in a compact fashion. But this energy transfer is more and more often controlled using electronic interfaces, and, ultimately, this transferred energy is converted into mechanical energy so that the dynamics of the electronic, the control and the mechanical system also need to be considered. When analyzing fluid power systems, it is therefore crucial that fluid power models be seamlessly integrated with models for these other disciplinary domains. 2. Modular model architecture. Fluid power systems are almost always designed as a configuration of commercial-off-the-shelf components. This modularity in the physical system should also be reflected in the fluid power model library. Modularity in the models allows the user to model an almost infinite number of system configurations from a small number of basic models, and can drastically reduce the effort needed to extend, improve and maintain the library. 3. Efficient simulation. Although modularity in the models reduces the modeling effort, it may also increase the computational cost of the resulting simulations. When using simulations to support design, repeated analyses of fluid power systems are typically required with different parameter values or circuit topologies. A good balance must be established between ease of modeling and efficiency of simulation. 4. Expressive model semantics. The dynamic modeling of fluid power systems requires that the modeling language be able to capture both differential and algebraic equations. In addition, the structure of the model equations often changes at discrete moments in time (e.g., when a valve opens or a cylinder reaches its end of travel). For fluid power systems, it is therefore desirable to use a modeling language that can express differential algebraic equations combined with discrete events. 5. Open and sharable. Models are formal expressions of our knowledge about a particular domain or phenomenon. To promote the exchange of knowledge about fluid power systems, it is important that the models be fully accessible to all stakeholders in the community. This means that the models are expressed formally without ambiguity, and that the full model equations can be viewed, critiqued and, if necessary, updated by the members of the community. Currently, there is not a single model library or simulation tool that excels at all of these criteria. In the remainder of this paper, the basic structure and philosophy of a new library is described which provides a better trade-off between these sometimes conflicting criteria. The library accomplishes this by taking advantage of the Modelica language with its formal, equation-based semantics that enable symbolic manipulation during compilation and efficient solving of the resulting differential algebraic equations. 2. SCOPE AND ARCHITECTURE OF THE MODEL LIBRARY 2.1 Scope of the model library The scope of the library is the dynamic behavior of fluid power systems. It is assumed that the components and physical phenomena can be adequately approximated using lumped parameter models described in Differential Algebraic Equations systems or DAEs (as opposed to distributed parameter models described in Partial Differential Equations). DAEs are commonly used for system-level modeling where the system dynamics result from the exchange of energy or signals between subsystems or components. This is an appropriate modeling paradigm when these interactions occur at well-defined interfaces or ports. Similar to the electrical and, to some extent, the mechanical and thermal domains, the fluidpower domain shares this systems-oriented approach: fluid power systems are composed from modular components connected to each other through standardized ports. At this point, the library is limited to hydraulic components, but it is the intent to expand the library in the future to include pneumatic components also. Even in the hydraulic domain, the library does not include models for all commercially available components. However, it does include most of the key building blocks from which these additional models can be defined. The intent has been to provide a well thought-out structure that can then be further developed in an open-source effort. 2.2 The Modelica modeling language Modelica (12) is a formal, object-oriented language geared towards the lumped-parameter modeling of system behavior resulting from the exchange of energy and signals between subsystems or components. The language provides an ideal platform for addressing all five criteria listed in Section 1: 1) The new fluid power library is seamlessly integrated with the open-source Modelica Standard Library which includes several domains: electrical (analog, digital, and multiphase), signals and controls (continuous, discrete, and state graphs), mechanical (translational, rotational, and 3D rigid-body dynamics), thermal and fluids. 2) Modelica is an object-oriented, noncausal, equation-based language that supports the development of modular, reusable models. The models have a well-defined, port-based interface so that they can be composed into larger systems using a graphical editor. 3) By taking advantage of the equation-based nature of Modelica, a solver can symbolically manipulate the equations and compile them into an executable that is commonly an order of magnitude faster than comparable procedural solvers (3). In addition, symbolic manipulation allows for the solution of structurally singular systems, i.e., with a DAE perturbation index larger than one (1). 4) Modelica has a broad, flexible set of modeling constructs for defining differential equations, algebraic equations, conditional equations, and discrete event handling. 5) Modelica is quickly becoming a de-facto standard for differential algebraic equation modeling. Modelica is supported by several simulation solvers including an open-source solver developed as part of the OpenModelica Project (16) (See http://www.modelica.org for a complete list of solvers). 2.3 Over view and general characteristics The fluid power library is developed in a modular fashion, in three layers. First, there is a layer (the package BasicModels) with models of basic physical phenomena such as the flow through an orifice, or an ideal lossless exchange between hydraulic and mechanical translational energy. In the second layer (the package Components), these basic models are combined into models for generic fluid-power components, such as servo valves, cylinders, or pumps. The third layer is strictly speaking not part of the library; it contains models for very specific components, such as pump ABC from company XYZ. In this layer, the generic models from the second layer are instantiated with specific values for all the model parameters reflecting the particular flow characteristics of a specific component. This layer should be structured by component vendor (e.g., a separate library, called XYZComponents, for components produced by vendor XYZ). The fluid power library also contains a package with models for fluids. The fluid models are completely separate from the component models so that a component can be modeled once and then used with a variety of fluids. The interface to the fluid model only assumes that the fluid properties depend on the local state: the pressure and temperature. Since the library deals with fluids, it has been based on the Modelica.Fluids library developed by Casella et al. (2) and on the Modelica.Media library developed by Elmqvist et al. (6). The fluid power library further extends these libraries by including phenomena, technologies and components that are specific to the fluid-power domain. 3. THE FLUID MODEL The behavior of a fluid power system is determined to a large extent by the properties of the fluid. Throughout the system, the relationships that define this fluid behavior need to be considered. In the fluid power library, these relationships are grouped together in a separate fluid model. The model is based on the models developed in the Modelica.Media package of the Modelica Standard Library (6). However, the structure of the model has been simplified so that only the relationships relevant to the fluid power domain (i.e., only hydraulic fluids at this point in time) have been retained. Even with this simplification, the model is still quite expressive compared to most other fluid power simulation tools. The model is structured as a replaceable package, meaning that the user can not only specify certain constant fluid properties, but has the total freedom to define how these properties depend on the fluid state, that is, the pressure and the temperature. The most common properties of the fluid are defined in a model called BaseProperties, which includes pressure, temperature, density, specific enthalpy, and specific internal energy. Stubs have been provided for the functions in which the relationships between these variables can be defined. For instance, if the user wants to evaluate the performance of the fluid power system under very high pressures, d_pT can be redeclared to consider the Tait equation rather than a constant bulk modulus: redeclare final function extends d_pT "Return density as a function of p and T (Tait equation)" import SI = Modelica.SIunits; protected SI.BulkModulus K0 "Temperature-dependent bulk modulus"; constant SI.BulkModulus K00 = 8.4e9 "Bulk modulus at 0K"; constant Real K0prime = 10.9 "Constant in Tait equation"; constant Real betaK(final unit="1/K")=0.0058 "Temp coefficient"; constant Real aV(final unit="1/K")=7.7e-4 "Therm. exp. coef."; constant Density d0 = 870 "Reference density at p0 and T0"; algorithm K0 := K00*Modelica.Math.exp(-betaK*T); d := d0/(1+aV*(T-T0))/ (1-Modelica.Math.log(1+p*(1+K0prime)/K0)/(1+K0prime)); end d_pT; Other quantities that are not part of the BaseProperties model are also pre-defined as function stubs that need to be redeclared by the user when creating a new fluid model; the most commonly used functions are dynamicViscosity and thermalConductivity. To make sure that the fluid model is used within its range of applicability, it is good practice to include assert statements, for instance, to assert that the absolute pressure be positive. If the assert statement fails, the simulation stops and an error message is displayed. 4. THE PACKAGE OF BASIC MODELS The BasicModels package contains all the basic building blocks from which componentlevel models can be constructed. These models include flow models through pipes and orifices, boundary condition models (sources and sinks), energy conversion models (to and from rotational and rotational mechanical energy), and models for fluid volumes. The models in this package are usually idealized models that need to be combined with other basic models to capture all the physical phenomena occurring in fluid power components. For instance, a WallFriction model for laminar-turbulent flow through a line needs to be combined with a Volume model to capture also the compliance of the line or hose. The BasicModels package is further divided into two: Thermal and NonThermal. In fluid power analyses, it is common to assume that the temperature has reached steady state and does not vary throughout the system. Taking this into account explicitly can result in a significant reduction in the size of the state of the system (and therefore in the computational cost of the simulation); therefore, the fluid power library has two sets of basic models — with and without a thermal state. The difference between the two types of models is minor and can usually be modeled through the inheritance mechanism: each model in the NonThermal package has an associated model in the Thermal package which extends the NonThermal model by adding the thermal balance equations. 4.1 The Energy Transfer Model To model the flow of energy, Modelica includes a restricted class called connector. A connector is defined by one or more across and through variables (or effort and flow variables in bond graph terminology (15)). When connecting two components by their matching connectors, Modelica automatically imposes the equivalents of Kirchhoff’s laws: the across variables are equal and the through variables add up to zero. In the fluid domain, a connector includes the variable pairs pressure / mass-flow rate and specific enthalpy / enthalpy-flow rate (2). The equivalent model in the NonThermal package omits the specific enthalpy and the enthalpy-flow rate. At first glance, it seems as though the enthalpy flow rate variable is redundant — given the mass flow rate and the specific enthalpy, the enthalpy flow rate can be determined. However, as is explained in detail in (6), the enthalpy flow rate is important to enable the modeling of splitting, joining and reverse fluid flow. For instance, fluid flowing from component A to component B is characterized by the specific enthalpy of component A. When the flow reverses, the specific enthalpy in the connector may change discontinuously because it is now determined by the fluid flowing from component B to component A. The causality for the assignment of the specific enthalpy in the connector needs to be reversed accordingly. The Modelica language includes the semiLinear construct to support this modeling approach (6). 4.2 The Flow Models The package BasicModels also contains models describing the flow of fluid through pipes and orifices: GenericPressureLoss, LaminarRestriction, SharpEdgedOrifice, SuddenExpansion, VariableRestriction, and WallFriction. These models have been derived from the Modelica.Fluid library (2). They have been simplified by explicitly taking into account the most common operating conditions for fluid power systems. Since flow rates in fluid power systems can change significantly over time (e.g., depending on the control signal of a servo valve), all the flow models (except LaminarRestriction account for both laminar and turbulent flow with cubic-spline interpolation in the transitional region, as is illustrated in Figure 1. At a pressure drop of zero, the two cubic polynomials meet and transition smoothly with matching first derivatives; the second derivatives are also matched as long as this does not result in a nonmonotonic function. The most commonly used flow model is the VariableRestriction model. It is the foundation for all the valves in the Components package. The flow characteristic of the variable restriction is defined by a tabular metering curve that relates a control input to the flow rate for a specified nominal pressure drop, nominal density, and nominal viscosity. Rather than imposing this flow rate under all flow and fluid conditions, the metering curve is used only to approximate a relationship between the control input and a corresponding diameter and loss factor. Based on this relationship, the flow rate is computed for current pressures, densities and viscosities, so that a reasonable approximation is obtained even when the flow and fluid conditions deviate from nominal. A second important flow model is the WallFriction model. This model represents the pressure loss in a straight pipe defined by its length, inner (hydraulic) diameter, and surface roughness. The flow characteristic is based on an implementation of a Moody chart and accounts for both laminar and turbulent flow (7). -4E5 -2E5 0E0 2E5 4E5 6E5 -400 -200 0 200 400 flo w ra te [l /m in ] pressure drop [Pa] quadratic laminar-turbulent Figure 1: The flow characteristic for an asymmetric, sharp-edged orifice. Note that, as for all models in the fluid power library, the flow models are noncausal. Their causality will be automatically determined by the Modelica compiler. As a result, the models could be connected to an ideal flow source (imposing a given mass flow rate) or to an ideal pressure source (imposing a given pressure drop) without any need for changes to the model. It is, however, possible for the user to specify a preferred causality so that costly root-finding can be avoided during simulation. It is also important to recognize that the models in the FluidPower library are lumped parameter models. Sometimes (e.g., for long lines) it may be desirable to include distributed parameter models. This can be achieved within the scope of the current library by discretizing the distributed component. For instance, a finite volume approach can be used to discretize a long line into a sequence of short segments each of which is characterized by a model from the BasicModels package. Modelica provides convenient constructs from defining such components in which the structure of the equations is parameterized. 3.4 Energy Conversion Models Since it is typically the purpose of fluid power systems to transfer energy in a compact fashion from a prime mover to a mechanical load, it is crucial to include models that convert the energy between the fluid power and mechanical domains. In the package BasicModels, the models are defined for such energy conversion under idealized, lossless conditions: FluidPower2MechTrans, FluidPower2MechRotConst and FluidPower2MechRotVar. In practical energy conversion components, there will of course always be losses due to mechanical friction or leakage, but these should be modeled in models of the actual components, as shown in Figure 2 for a hydraulic cylinder. The mechanical interfaces for the models are defined in Modelica.Mechanics. Translational and Rotational in the Modelica Standard Library. 4. THE PACKAGE OF COMPONENT MODELS Whereas the BasicModels package described the physical phenomena that occur in fluid power systems, the Components package describes how these physical phenomena interact with each other to achieve the functions of actual fluid power components. To maintain this clear distinction and to facilitate modularity and model reuse, all the component models are purely compositions or extensions of basic models or other component models. The models in the Components package are divided into sub-packages for Cylinders, Lines, MotorsPumps, Sensors, Valves, and Volumes. Rather than describing every model in every package in this paper, only a few representative models are described to illustrate the modeling approach. 4.1 Maintaining consistent fluid models The component models all extend the partial model PartialFluidComponent. This partial model simply states which fluid model should be used and whether thermal energy exchange is to be considered in the fluid flow. By default, the fluid model is GenericOil, but the user can replace it with any model from the Fluids package. Similarly, by default, no thermal energy exchange is considered (i.e., only pressure and mass flow rate are included in the fluid connectors). To maintain consistency of the fluid properties throughout the system, this medium model and basic package are passed on to all the subcomponents or basic models used to describe the component. Using a redeclaration for every subcomponent, the consistency of the Basic and Medium models is maintained throughout the component model and, at a higher level, throughout the model of the entire fluid power circuit. 4.2 A Simple Model: A Double Acting Cylinder As an example of how basic models can be combined into realistic component models, consider the DoubleActingCylinder model depicted in Figure 2. The cylinder model combines models from FluidPower.BasicModels with models from Modelica.Mechanics.Translational and Modelica.Thermal.HeatTransfer to describe the hydraulic, mechanical and thermal behavior of the component. Hydraulically, the cylinder is described by two fluid chambers that are rigidly connected to each other by a piston. There is leakage between the two chambers, across the piston seal, as well as between each chamber and the environment. The environment is modeled as a constant pressure sink. Each cylinder chamber also includes equations that describe the large mechanical stiffness and damping that occur when the chamber empties and the piston touches the cylinder end cap. The mechanical aspect of the model further includes an inertia representing the piston, a damper representing the friction between the piston and the cylinder, and two rigid connections representing the constant lengths of the cylinder and the rod. cylinderChamberLef t cylinderChamberRight pis ton cylinder
منابع مشابه
ExternalMedia: A Library for Easy Re-Use of External Fluid Property Code in Modelica
The modeling of thermo-physical fluid properties is of great importance when modeling thermo-fluid systems. The Modelica Standard Library provides a number of medium models that can be used in component models but are not sufficient in many applications. This paper presents a new interface library with a Modelica front-end that allows for an easy inclusion of external fluid property code in Mod...
متن کاملModelica Buildings Library 2.0
This paper presents an update about recent additions to the Modelica Buildings library. The Modelica Buildings library is a free open-source library with dynamic simulation models for building energy and control systems. The library contains models for air-based HVAC systems, chilled water plants, water-based heating systems, controls, room and envelope heat transfer, multizone airflow, includi...
متن کاملIntroduction to Object-oriented Modeling and Simulation with Modelica Using the Openmodelica Environment
Modelica is a modern, strongly typed, declarative, equation-based, and object-oriented language for modeling and simulation of complex systems. Major features are: ease of use, visual design of models with combination of lego-like predefined model building blocks, ability to define model libraries with reusable components, support for modeling and simulation of complex applications involving pa...
متن کاملEfficient Analysis of Harmonic Losses in PWM Voltage Source Induction Machine Drives with Modelica
This paper presents an approach to calculate the copper and core losses caused by harmonics of the PWM of a voltage source inverter. For the analysis some models of the Smart Electric Drives (SED) library, and additionally, a Modelica library for modeling AC circuits by means of electric time phasors, are used. With the proposed analysis the influence of space phasor PWM signals on the machine ...
متن کاملBond Graph Model Of A Water Heat Exchanger
This paper presents a Bond Graph (BG) modelling approach to add and exploit on existing Modelica models some information on the energy structure of the systems. The developed models in the ThermosysPro library (Modelica-based) are already validated against the experimental data in previous works. A plate heat exchanger (PHE), which is equipment for nuclear power plants, is considered as a case ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008